// https://www.nuxtjs.org.cn/directory-structure/nuxt-config.html#%E5%88%AB%E5%90%8D-alias
export default defineNuxtConfig({
  //https://nuxt.com/modules
  modules:["@hebilicious/vue-query-nuxt","@pinia/nuxt",'@vueuse/nuxt','@nuxtjs/tailwindcss','@element-plus/nuxt'],
  elementPlus: {
    icon: 'ElIcon',
    importStyle: 'css',
  },
  build:{
    //使用babel进行语法转化
    transpile: ['@headlessui/vue'],
  },
  devServer:{
    port:9999
  },
  sourcemap:{
    server: false,
    client: false
  },
  vite:{
    // 自动导入样式插件
    plugins:[],
  },
  //混合渲染模式
  routeRules:{
    "/" : {ssr : true},
    "/home" :{ssr:false}, //spa 应用
    "/about" :{ssr:false}, //spa 应用
  },
  //运行时配置
  runtimeConfig:{
    appKey:'nuxt3', //runtimeConfig下的服务的可读取
    //public 的值在服务端和客户端都可以访问
    public:{
      baseUrl:'http://codercba.com:9060/oppo-nuxt/api'
    }
  },
  typescript: {
    tsConfig: {
      compilerOptions: {
        strict: true,
        types: ['@pinia/nuxt'],
      },
    },
  },
  //全局样式配置
  css:["@/assets/css/global.css","normalize.css","~/assets/cus-font/iconfont.css"],
  // 3.配置app
  app: {
    head: {
      title: "nxut3",
      meta: [
        {
          name: "viewport",
          content: "width=device-width, initial-scale=1, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no",
        },
        {
          charset: "utf-8",
        },
        {
          name: "description",
          content:
              "OPPO专区，官方正品，最新最全的OPPO手机产品以及配件在线抢购！",
        },
        {
          name: "keywords",
          content: "OPPO商城，OPPO专区, OPPO手机，OPPO配件，OPPO, OPPO官网商城",
        }
      ],
      link: [
        {
          type: "image/x-icon",
          rel: "shortcut icon",
          href: "/favicon.ico",
        },
      ],
      style: [
        {
          // children: `body{ color: red }`,
        },
      ],
      script: [
        {
          src: "",
        },
        {
          children: 'console.log("hello nuxt");',
        },
      ],
      noscript: [
        {
          children: "当前浏览器器不支持脚本或已禁用",
        },
      ],
    },
  },
})
